<%inherit file="/base/user.html"/>
<p> Displaying general information about cluster ${c.cluster_display_name}. The cluster
has following queue(s):
<ul>
% if not c.queues_names:
<li class="error_status"> NO QUEUE AVAILABLE</li>
%else:
    %for queue in c.queues_names:
        <%id = c.cluster_hostname + '/' + queue %>
    <li> ${h.link(h.url_for(action='show', id=id), queue)}</li>
    %endfor
%endif
</ul>
All available paramters about this cluster are:</p>
<div id="${c.cluster_hostname}_container">
<table id="${c.cluster_hostname}_table">
    <thead> 
        <tr>
          <th> Cluster Parameter</th>
          <th> Value(s)</th>
        </tr>
    </thead>
    <tbody>
    %for param in c.cluster_obj.get_attribute_names():
        %for value in c.cluster_obj.get_attribute_values(param):
        <tr>
            <td >${param} </td>
            <td> ${value} </td> 
        </tr> 
     %endfor
    %endfor
    </tbody>
</table>
</div>

<script type="text/javascript">
YAHOO.util.Event.addListener(window, "load",function(){
    var myColumnDefs = [
        {key:"Cluster Parameter", sortable:true},
        {key:"Value(s)", sortable:true, resizeable:true}
    ];
    var myDataSource = new YAHOO.util.DataSource(YAHOO.util.Dom.get("${c.cluster_hostname}_table"));
    
    myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
    
    myDataSource.responseSchema = {
        fields: [{key:"Cluster Parameter"}, {key:"Value(s)"}]
        };

    var myDataTable = new YAHOO.widget.DataTable("${c.cluster_hostname}_container", myColumnDefs, myDataSource,
    {caption:"Cluster Info for ${c.cluster_display_name}", summary: "GRIS Information about cluster ${c.cluster_display_name}"});
});
</script>


<%def name="css()">
    ${parent.css()}
    ${self.css_link('/css/yui/build/datatable/assets/skins/sam/datatable.css', 'screen')}
</%def>

<%def name="js()">
    ${parent.js()}
    <script type="text/javascript" src="/js/yui/build/dragdrop/dragdrop-min.js"></script>
    <script type="text/javascript" src="/js/yui/build/element/element-min.js"></script>
    <script type="text/javascript" src="/js/yui/build/datasource/datasource-min.js"></script>
    <script type="text/javascript" src="/js/yui/build/datatable/datatable-min.js"></script>
</%def>
